#!/usr/bin/env bash

################################################################################
# Runs python doctest on all python source files in the cirq directory.
#
# See also:
#     https://docs.python.org/3/library/doctest.html
#
# Usage:
#     check/doctest [-q]
#
# The -q argument suppresses all output except the final result line and any
# error messages.
################################################################################

# Get the working directory to the repo root.
thisdir=$(dirname "${BASH_SOURCE[0]:?}") || exit $?
repo_dir=$(git -C "${thisdir}" rev-parse --show-toplevel) || exit $?
cd "${repo_dir}" || exit $?

source dev_tools/pypath || exit $?

python dev_tools/docs/run_doctest.py "$@"
